#include<iostream>
int main()
{
	int s[10],n,i,j,aux;
  	std::cout<<"n=";std::cin>>n;
	for(i=0;i<n;i++)
	{ 
		std::cout<<"s["<<i<<"]=";
	        std::cin>>s[i];
	}
	for(i=0;i<n/2;i++)
		for(j=n/2;j<n;j++)
  			if(s[i]%2!=0 && s[j]%2==0)
   			{
				aux=s[i];
				s[i]=s[j];
				s[j]=aux;
			}		
	for(i=0;i<n;i++)
		std::cout<<s[i]<<" ";
	std::cout<<"\n";
	return 0;
}
